package name.as3.simpleUIComponents.defaultSkins
{
import flash.display.DisplayObject;

import name.as3.simpleUIComponents.core.SimpleSprite;
import name.as3.simpleUIComponents.interfaces.skinParts.IButtonStateDisplayObject;
import name.as3.simpleUIComponents.interfaces.skins.ISimpleButtonSkin;

public class DefaultSimpleButtonSkin 
	extends SimpleSprite implements ISimpleButtonSkin, IButtonStateDisplayObject
{
	private var m_dAlpha:Number = .3;
	/**
	 *
	 */
	public function DefaultSimpleButtonSkin()
	{
		super();
	}
//==================================================================================================
// public
//==================================================================================================
	override public function setSize(nW:Number, nH:Number):void
	{
		graphics.clear();
		graphics.beginFill(0, m_dAlpha);
		graphics.drawRoundRect(0, 0, nW, nH, 8, 8);
		graphics.endFill();
	}
//==================================================================================================
// public interfaces
//==================================================================================================
	public function up():void
	{
		m_dAlpha = .3;
		setSize(this.width, this.height);
	}
	public function over():void
	{
		m_dAlpha = .5;
		setSize(this.width, this.height);
	}
	public function down():void
	{
		m_dAlpha = .2;
		setSize(this.width, this.height);
	}
	
	public function get backgroundImage():IButtonStateDisplayObject
	{
		return this;
	}
}
}